
function rolelist(state = [], action = { type: "", payload: null }) {
    // 对state进行深拷贝
    var newstate = JSON.parse(JSON.stringify(state));
    // 判断action的类型，根据action的类型执行不同的操作来修改state
    switch (action.type) {
        case 'addrolelist': newstate = action.payload;
            return newstate;
        case 'searchrolelist': newstate = action.payload;
            return newstate;
        case 'deleterolelist': newstate = action.payload
            return newstate;
        case 'newaddrolelist': newstate = action.payload
            return newstate;
        case 'editrolelist': newstate = action.payload
            return newstate;

        // case 'PUSHlist':
        //     newstate.push(action.payload);
        //     return newstate;
        default: return state;
    }
}
export default rolelist;